import re,urllib,urllib2
def file_write(filename,data):
	f = open(filename,'w')
	f.write(data)
	f.close()

def file_read(filename):

	f = open(filename)
	data = f.read()
	f.close()
	return data
# data = file_read('test1.html')
request = urllib2.Request('http://tieba.baidu.com/p/4507524795')
response = urllib2.urlopen(request)
b = ''
for i in response:
	b+=i 
# print b
pattern = re.compile('<img class="BDE_Image" src="(.*?)" size="\d{6} changedsize="true" width="\d{3}" height="\d{3}" size="\d{3}">',re.S)# reseult = re.search(pattern,data)
# reseult = re.findall(pattern,b)
print b
# print reseult
# items = re.findall(pattern,data)
# # file_write('span.txt',items)
# for item in items:
# 	haveImg = 
#     print item[0],item[1],item[2],item[3]
# # print data
# # print items
